package com.yy.poly_.polyarr_;

/**
 * chapter08  com.yy.poly_.polyarr_
 * 2023-04-07 15:44
 *
 * @author yy yuyue
 * description : 不可描述
 * @date 2023/4/7 15:44
 */
public class Student extends Person{
    private double score;
    public Student(String name, int age, double score){
        super(name,age);
        this.score = score;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    //重写父类的say()方法

    @Override
    public String say() {
        return super.say() + " 学生" + " score = " + score;
    }

    //特有的方法
    //方法前面使用public,属性前面使用private
    public void study(){
        System.out.println("学生 " + getName() + " 正在学Java课程...");
    }
}
